﻿@model List<Galaxy.Entities.Role>
@section styles{
    <link href="~/lib/AdminLTE/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" asp-append-version="true" />
    <link href="~/lib/bootstrap-treeview/dist/bootstrap-treeview.min.css" rel="stylesheet" asp-append-version="true" />
    <link href="~/css/base.css" rel="stylesheet" asp-append-version="true" />
    <style type="text/css">
        .trchange {
            background-color: #08C;
            color: white;
        }
    </style>
}
@section scripts{
    <script src="~/lib/bootstrap-treeview/dist/bootstrap-treeview.min.js" asp-append-version="true"></script>
    <script src="~/view-resources/Views/Permission/Index.js" asp-append-version="true"></script>
}
<div class="content-wrapper" id="mainDiv" style="min-height: 935px;">
    <section class="content-header">
        <h1>角色授权</h1>
        <ol class="breadcrumb">
            <li><a href=""><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">系统管理</a></li>
            <li class="active">角色授权</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- /.col -->
            <div class="col-md-8">
                <div class="box box-primary">
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div id="role_table_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="dataTables_filter" id="searchDiv">
                                        <input placeholder="请输入名称" name="name" class="form-control" type="search" likeoption="true">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-primary" data-btn-type="search">查询</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="role_table" class="table table-bordered table-striped table-hover dataTable no-footer" style="width: 100%;" role="grid">
                                        <thead>
                                            <tr role="row">
                                                <th class="text-center sorting_disabled" rowspan="1" colspan="1" aria-label="序号">序号</th>
                                                <th class="text-center sorting" tabindex="0" aria-controls="role_table" rowspan="1" colspan="1" aria-label="名称: activate to sort column ascending">名称</th>
                                                <th class="text-center sorting_asc" tabindex="0" aria-controls="role_table" rowspan="1" colspan="1" aria-label="编码: activate to sort column descending" aria-sort="ascending">编码</th>
                                                <th class="text-center sorting" tabindex="0" aria-controls="role_table" rowspan="1" colspan="1" aria-label="是否可用: activate to sort column ascending">是否可用</th>
                                                <th class="text-center sorting_disabled" rowspan="1" colspan="1" aria-label="备注">备注</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @for (int i = 0; i < Model.Count; i++)
                                            {
                                                <tr id="@Model[i].Id" role="row" class='@(i % 2 == 0 ? "even" : "odd")'>
                                                    <td class="text-center sorting_1">@(i + 1)</td>
                                                    <td class=" text-center">@Model[i].Name</td>
                                                    <td class=" text-center">@Model[i].Code</td>
                                                    <td class=" text-center">@(Model[i].Status == 0 ? "可用" : "不可用")</td>
                                                    <td class=" text-center">@Model[i].Remark</td>
                                                </tr>
                                            }
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-5"></div>
                                <div class="col-sm-7"></div>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>
            <div class="col-md-4">
                <!-- Profile Image -->
                <div class="box box-primary">
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div id="roleFunc_table_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="dataTables_filter" style="margin-bottom:10px;" id="searchRole">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-default" data-btn-type="authorize">授权</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="box box-primary">
                                        <div class="box-body box-profile">
                                            <div id="tree" class="treeview">

                                            </div>
                                        </div>
                                        <!-- /.box-body -->
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-5"></div>
                                <div class="col-sm-7"></div>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
        </div>
        <!-- /.row -->
    </section>
</div>